<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        /* Reset some default styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* Set up body with center alignment and gradient background */
        body {
            font-family: 'Arial', sans-serif;
            background: linear-gradient(135deg, #4e8dd2, #2a6eb8);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        /* Styling for the login container */
        .login-container {
            background-color: #ffffff;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            text-align: center;
            transition: transform 0.3s ease;
        }

        .login-container:hover {
            transform: scale(1.05);
        }

        /* Title style */
        .login-container h1 {
            font-size: 28px;
            color: #4e8dd2;
            margin-bottom: 10px;
        }

        .login-container h2 {
            font-size: 22px;
            margin-bottom: 20px;
            color: #333;
        }

        /* Input group styling */
        .input-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .input-group label {
            font-size: 14px;
            color: #666;
            margin-bottom: 5px;
            display: block;
        }

        .input-group input {
            width: 100%;
            padding: 12px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 8px;
            outline: none;
            transition: border 0.3s ease, box-shadow 0.3s ease;
        }

        .input-group input:focus {
            border-color: #4e8dd2;
            box-shadow: 0 0 5px rgba(78, 141, 210, 0.6);
        }

        /* Button styling */
        button {
            width: 100%;
            padding: 12px;
            background-color: #4e8dd2;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        button:hover {
            background-color: #3a7cc3;
        }

        button:active {
            background-color: #2a6eb8;
        }
    </style>
</head>
<body>

<div class="login-container">
    <h1>智能盲杖监测系统</h1>
    <form id="loginForm">
        <div class="input-group">
            <label for="username">用户名</label>
            <input type="text" id="username" placeholder="请输入用户名" required>
        </div>

        <div class="input-group">
            <label for="password">密码</label>
            <input type="password" id="password" placeholder="请输入密码" required>
        </div>

        <button type="submit">登录</button>
    </form>
</div>

<script>
    document.getElementById('loginForm').addEventListener('submit', function(event) {
        event.preventDefault(); // 阻止表单默认提交行为

        // 这里可以添加实际的登录验证逻辑
        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;

        // 模拟登录成功，默认为user，123456（根据需要修改）
        if (username=="user" && password=="123456") {
            // 登录成功后跳转到 index.html
            window.location.href = 'index.html';
        } else {
            alert('请输入用户名和密码');
        }
    });
</script>

</body>
</html>
